from flask import Blueprint

# 创建蓝图对象
admin_blu = Blueprint("admin", __name__,url_prefix="/admin")

# 让视图函数和主程序建立关联
from info.modules.admin.views import *

# 蓝图请求钩子
@admin_blu.before_request
def check_superuser():
    is_admin = session.get("is_admin")
    if not is_admin and not request.url.endswith("admin.login"):
        return redirect(url_for("home.index"))